<template>
  <div>
    <div class="headercontent">
      <div class="circle sunset"></div>
      <div class="circle coolice"></div>
      <div class="circle timber"></div>
      <div class="circle pig"></div>
      <div class="circle friday"></div>
    </div>

    <div class="relative">
      <h1>问卷发布成功</h1>
      <h3>问卷地址：{{ url }}</h3>
                  <el-button  type="success" plain @click="closeAll">关闭问卷</el-button>

        <router-link to="/"><el-button class="rightBtn" type="primary" plain>点击回到主页</el-button></router-link>
      <el-button class="rightBtn" type="danger" plain @click="copyUrl">复制问卷地址</el-button>

    </div>
  
  </div>
</template>
<script >
import { ElMessage, ElMessageBox } from "element-plus";

export default {
  name: "PublishResultView",
  components: {ElMessage,ElMessageBox},
  data() {
    return {
      url: "",
    };
  },
  mounted() {
    let url = this.$route.query.url;
    this.url = url;
  },
  methods: {
     closeAll() {
      window.opener = null;
      window.open("", "_self");
      window.close();
    },
    copyUrl(){
          // 存储传递过来的数据
          let OrderNumber = this.url;
          // 创建一个input 元素
          // createElement() 方法通过指定名称创建一个元素
          let newInput = document.createElement("input");
          // 讲存储的数据赋值给input的value值
          newInput.value = OrderNumber;
          // appendChild() 方法向节点添加最后一个子节点。
          document.body.appendChild(newInput);
          // 选中input元素中的文本
          // select() 方法用于选择该元素中的文本。
          newInput.select();
          // 执行浏览器复制命令
          //  execCommand方法是执行一个对当前文档，当前选择或者给出范围的命令
          document.execCommand("Copy");
          // 清空输入框
          newInput.remove();
          // 下面是element的弹窗 不需要的自行删除就好
          ElMessage.success("复制成功");
    }
  },
};
</script>

<style  scoped>


html {
  min-height: 100%;
  height: 100%;
}
body {
  background: #f6f6f8;
  margin: 0;
  padding: 0;
  font-family: Raleway, Helvetica Neue, Helvetica, Arial, sans-serif;
  font-weight: 400;
  overflow: hidden;
}

h3{
  margin-bottom: 40px;
    margin-top: 60px;

}
.rightBtn{
  margin-left: 10px;
}
/**********************************/
/******* 2.0 Content Styles *******/
/**********************************/
.relative {
  text-align: center;
  width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 110;
  margin-top: 120px;
  background: #f6f6f6;
  opacity:0.8;
  padding: 60px;
  border: 1px solid #dedede;
  border-radius: 10px;
}
h1 {
  color: #111215;
  font-size: 30px;
  position: relative;
  font-weight: 500;
}
h2 {
  color: #252629;
  font-weight: 500;
  margin-bottom: 40px;
  margin-top: 60px;
}

a:hover {
  opacity: 0.8;
}
.svg {
  height: 16px;
  width: 16px;

  margin-top: 4px;
  padding: 12px;
  margin-right: 10px;
  background: rgba(255, 255, 255, 0.4);
  -webkit-border-radius: 50px;
  -moz-border-radius: 50px;
  border-radius: 50px;
  float: left;
}
.circle {
  left: 0;
  border-radius: 50%;
  overflow: hidden;
  position: absolute;
  z-index: 0;
  animation-direction: alternate;
}
.circle:after {
  content: "";
  background: -moz-radial-gradient(
    center,
    ellipse cover,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.2) 100%
  );
  background: -webkit-radial-gradient(
    center,
    ellipse cover,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.2) 100%
  );
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.2) 100%
  );
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#33ffffff', GradientType=1);
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
.circle.sunset {
  width: 19.71721547vh;
  height: 19.71721547vh;
  top: -19.71721547vh;
  background: #00d2ff;
  background: #ff5f6d;
  background: -webkit-linear-gradient(-45deg, #ffc371, #ff5f6d);
  background: linear-gradient(-45deg, #ffc371, #ff5f6d);
  animation: orb1 30s cubic-bezier(0.27, 0.96, 0.58, 1) alternate infinite;
  opacity: 0.81893813;
}
.circle.coolice {
  background: #4ca1af;
  background: -webkit-linear-gradient(-45deg, #c4e0e5, #4ca1af);
  background: linear-gradient(-45deg, #c4e0e5, #4ca1af);
  width: 14.73660403vh;
  height: 14.73660403vh;
  top: -14.73660403vh;
  animation: orb2 26s cubic-bezier(0.27, 0.96, 0.58, 1) alternate infinite;
  opacity: 0.60105231;
}
.circle.timber {
  background: #fc00ff;
  background: -webkit-linear-gradient(45deg, #00dbde, #fc00ff);
  background: linear-gradient(45deg, #00dbde, #fc00ff);
  width: 23.45698356vh;
  height: 23.45698356vh;
  top: -23.45698356vh;
  animation: orb3 43s cubic-bezier(0.27, 0.96, 0.58, 1) alternate infinite;
  opacity: 0.86555096;
}
.circle.pig {
  background: #ee9ca7;
  background: -webkit-linear-gradient(to right, #ffdde1, #ee9ca7);
  background: linear-gradient(to right, #ffdde1, #ee9ca7);
  width: 19.3966873vh;
  height: 19.3966873vh;
  top: -19.3966873vh;
  animation: orb4 32s cubic-bezier(0.27, 0.96, 0.58, 1) alternate infinite;
  opacity: 0.85714533;
}
.circle.friday {
  background: #83a4d4;
  background: -webkit-linear-gradient(84deg, #b6fbff, #83a4d4);
  background: linear-gradient(84deg, #b6fbff, #83a4d4);
  width: 4.5730166vh;
  height: 4.5730166vh;
  top: -4.5730166vh;
  animation: orb5 40s cubic-bezier(0.27, 0.96, 0.58, 1) alternate infinite;
  opacity: 0.80555259;
}
@keyframes orb1 {
  0% {
    transform: translatey(150vh) translatex(0vw);
  }
  100% {
    transform: translatey(-14.61170804vh) translatex(144.06001722vw);
  }
}
@keyframes orb2 {
  0% {
    transform: translatey(0vh) translatex(60vw);
  }
  100% {
    transform: translatey(73.54784271vh) translatex(193.67924086vw);
  }
}
@keyframes orb3 {
  0% {
    transform: translatey(70vh) translatex(70vw);
  }
  100% {
    transform: translatey(56.58155836vh) translatex(50vw);
  }
}
@keyframes orb4 {
  0% {
    transform: translatey(50vh) translatex(10vw);
  }
  100% {
    transform: translatey(79.19494351vh) translatex(1.58445831vw);
  }
}
@keyframes orb5 {
  0% {
    transform: translatey(80vh) translatex(80vw);
  }
  100% {
    transform: translatey(106.07528083vh) translatex(62.40398788vw);
  }
}
.headercontent {
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1;
}
</style>
